/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package logica;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author francisco tiapa
 */
public class PeticionToken {
 
    private int maquina;
    private Connection conexion;
   




    public int buscarIdMaquina() throws SQLException{
            ConexionBD c = new ConexionBD();
            conexion = c.conectarBD();
            String query = "SELECT id FROM maquinas  ";
            PreparedStatement ps = conexion.prepareStatement(query);
            ResultSet rs = ps.executeQuery();
            while (rs.next()) {
            maquina=rs.getInt(1);

            }

            return maquina;
    }

    public int getMaquina() {
        return maquina;
    }

    public void setMaquina(int maquina) {
        this.maquina = maquina;
    }

}
